import type { App } from "vue";
import * as JxtechComponents from "./components";
import { ConfigProviderContext, provideGlobalConfig } from "element-plus";

const excludeComponentNameList: string[] = [];
console.log(JxtechComponents);
const install = (app: App, options: ConfigProviderContext) => {
  provideGlobalConfig(options, app, true);
  for (const [key, component] of Object.entries(JxtechComponents)) {
    if (component.name) {
      if (!excludeComponentNameList.includes(component.name)) {
        app.component(component.name, component);
      }
    } else {
      console.warn("组件注册失败，组件名未定义");
    }
  }
};

export default { install };
